package day0108;

public class Test7 {

    public static void main(String[] args) {
        judgeLeapYear(1800, 2024);
    }


    //打印一个范围内的所有闰年
    static void judgeLeapYear(int start,  int end){
        for (int year = start; year <= end; year++) {
            if(year % 400  ==  0   ||    (year%4  == 0  && year % 100  !=  0 )    ){
                System.out.println(year + "是闰年");
            }
        }
    }







    void judgeLeapYear2(int year){
            if(year % 400  ==  0   ||    (year%4  == 0  && year % 100  !=  0 )    ){
                System.out.println("是闰年");
            }else{
                System.out.println("不是闰年");
            }
    }
}
